//
//  HZGoodsLoadMoreView.m
//  app
//
//  Created by 刘华舟 on 15/6/19.
//  Copyright (c) 2015年 hdaren. All rights reserved.
//

#import "HZGoodsLoadMoreView.h"

@implementation HZGoodsLoadMoreView

- (void)drawRect:(CGRect)rect{
    [self drawHorizonLineLeft:[self.ubo uw:0] right:[self.ubo uw:0] at:[self.ubo fh:UB_TOP ph:0.5] color:HZ_MALL_M_SEPARATOR_CELL_LINE];
    [self drawHorizonLineLeft:[self.ubo uw:0] right:[self.ubo uw:0] at:[self.ubo fh:UB_TOP uh:kSizeMallViewMargin ph:-0.5] color:HZ_MALL_M_SEPARATOR_CELL_LINE];
}

- (instancetype)initWithFrame:(CGRect)frame{
    if (self= [super initWithFrame:frame]) {
        self.backgroundColor = HZ_WHITE_COLOR;
        self.frame = CGRectOf([UBO_SCREEN fx:UB_LEFT fy:UB_TOP],[UBO_SCREEN fw:UB_WIDTH fh:UB_HEIGHT]);
        
        UIView *sepcView = [[UIView alloc] initWithFrame:CGRectOf([self.ubo fx:UB_LEFT fy:UB_TOP py:0.5], [self.ubo fw:UB_WIDTH uh:kSizeMallViewMargin ph:-1])];
        sepcView.backgroundColor = HZ_MALL_S_LIGHT_GRAY_BACKGROUND_COLOR;
        [self addSubview:sepcView];
        
        UILabel *label = [[UILabel alloc] initWithFrame:CGRectOf([self.ubo fx:UB_LEFT fy:UB_TOP uy:2*kSizeMallViewMargin], [self.ubo fw:UB_WIDTH fh:UB_HEIGHT uh:-2*kSizeMallViewMargin])];
        label.text = @"上拉查看商品详情";
        label.textAlignment = NSTextAlignmentCenter;
        label.textColor = HZ_MALL_TEXT_M_LIGHTGRAY_COLOR;
        label.font = JKAppGlobleFontContentText;
        [label sizeToFit];
        label.frame = CGRectOf([self.ubo fx:UB_CENTER ox:-label.ubo.width/2 fy:UB_TOP uy:2*kSizeMallViewMargin], label.ubo.size);

        [self addSubview:label];
        
        //箭头
        UIImageView *arrow = [[UIImageView alloc] initWithFrame:CGRectOf([label.ufo fx:UB_LEFT ox:-label.ubo.height fy:UB_TOP],
                                                                 [self.ubo ow:label.ubo.height oh:label.ubo.height])];
        
        [arrow setImage:[UIImage imageNamed:kImageArrowTop]];
        
        arrow.contentMode = UIViewContentModeRight;
        
        [self addSubview:arrow];

    }
    
    return self;
}

@end
